<?php
/*
 * V2 版本，公有接口
 * 完整路由是 api.laohoulundao.com/api/v2/xxx
 * */

 $api = app('Dingo\Api\Routing\Router');             // API 路由接管
$option = [
        'namespace' => 'App\Http\Controllers\Api\V4',
        'prefix'    => 'api/v2',
        'middleware'=> 'V2check'
    ];
 $api->version('v1',$option , function ($api) {

     /*=========首页========*/
     $api->post('/homelist', 'HomeController@getHomeList');              //首页 综合数据

     /*=========用户========*/
     $api->post('/addmessage',   'MemberController@suggestionsStore');   //意见反馈
     $api->post('/checkmobile',  'MemberController@checkMobile');        //会员-检查用户是否存在

     $api->post('/login', 'MemberController@login');              //会员-登录
     $api->post('/login-v3', 'MemberController@login_v3');        //会员-登录
     $api->post('/loginout', 'MemberController@login_out');          //会员-退出登录
     $api->post('/memberdetail', 'MemberController@get_member_info');    //会员详细

     $api->post('/memimg', 'MemberController@upload_member_head_img'); //上传头像
     $api->post('/memupdate', 'MemberController@update_member_name');     //修改会员名称
     $api->post('/update_member_info', 'MemberController@update_member_info');//修改会员资料


     $api->post('/register', 'MemberInfoController@register');           //会员-注册
     $api->post('/register-mobile-v3', 'MemberController@mobile_register_v3');           //会员-注册

     $api->post('/addmobcode', 'MemberController@add_mobile_code');         //发送验证码
     $api->post('/checkmobcode', 'MemberController@check_mobile_code');       //检查验证码

     $api->post('/membersumup', 'MemberCenterController@getMemBookSumUp');      //读书改进计划
     $api->post('/membercollect', 'MemberCenterController@getMemBookCollect');    //收藏记录
     $api->post('/memberviewlog', 'MemberCenterController@getMemBookViewLog');    //观看记录
     $api->post('/memdelcollect', 'MemberCenterController@delMemBookCollect');    //删除收藏
     $api->post('/memberrenew', 'MemberCenterController@getMemRenew');          //缴费记录

     $api->post('/dayslist', 'AudioController@getAudioDayList');                     //每日一言
     $api->post('/audio/record_view_times', 'AudioController@record_view_times'); //记录播放次数


     //书籍
     $api->post('/booktypelist', 'BookController@getBookType');          //书籍分类
     $api->post('/hotslist', 'BookController@getBookHotsList');      //热门书籍
     $api->post('/bookrecommendlist', 'BookController@getBookRecommendList'); //推荐书籍

     $api->post('/bookproject', 'BookController@bookSumUpStore');    //添加 读书改进计划
     $api->post('/bookcollect', 'BookController@bookCollectStore');  //收藏 书籍
     $api->any('/sendBookPpt','BookController@send_book_ppt');      //获得书籍PPT邮件

     $api->post('/partnerdetail', 'MemberDRPController@memDRPDetail');            //合伙人详细
     $api->post('/commissionlist', 'MemberDRPController@commission');              //佣金和提现记录
     $api->post('/banknamelist', 'MemberDRPController@getBankName');             //银行接口
     $api->post('/paycardlist', 'MemberDRPController@paycard');                 //提现账号列表
     $api->post('/addmemalicard', 'MemberDRPController@aliPayCardStore');         //添加提现账号--支付宝
     $api->post('/addmembankcard', 'MemberDRPController@bankPayCardStore');        //添加提现账号--银行卡
     $api->post('/updefault', 'MemberDRPController@upPayCardDefault');        //设置默认提现账号
     $api->post('/addmobpaycode', 'MemberDRPController@addMobCode');              //发送提现短信验证

     $api->post('/invoicelist', 'MemberDRPController@invoiceInfo');         //发票信息
     $api->post('/drawmoney', 'MemberDRPController@withdrawMoneyStore');  //提现申请
     $api->post('/friendlist', 'MemberDRPController@memFriendList');   //我的好友
     $api->post('/defaulttemp', 'MemberDRPController@defaultTemplate'); //推荐好友
     $api->post('/addtempimg', 'MemberDRPController@temoImgStore');    //生成模板


     /***=========== 读书会--开始 ==========***/


     $api->post('/modifyhomegroup', 'ReadingPartyController@read_party_index');                     //读书会首页
     $api->post('/read_party_index', 'ReadingPartyController@read_party_index');                     //读书会首页


     $api->post('/modifyindividual', 'ReadingPartyController@add_personal_read_party');           //个人
     $api->post('/add_personal_read_party', 'ReadingPartyController@add_personal_read_party');          //添加 个人读书会

     //$api->post('/modifyenterprise',     'ReadingPartyController@modifyreadingPartyEnterpriseStore');    //企业
     $api->post('/modifyenterprise', 'ReadingPartyController@add_company_read_party_v3');    //企业
     $api->post('/add_company_read_party', 'ReadingPartyController@add_company_read_party_v3');        //添加 企业读书会


     $api->post('/quitgroup', 'ReadingPartyController@quit_read_party');     //退出读书会

     $api->post('/groupview', 'ReadingPartyController@readingPartydetail');   //查看读书会
     $api->post('/addzan', 'ReadingPartyController@zanStore');             //点赞改进计划

     $api->post('/sumupcommentlist', 'ReadingPartyController@sumupComment');         //全部评论

     $api->post('/addreply', 'ReadingPartyController@add_read_plan_comment');    //发表评论


     //$api->post('/sumupreplylist',   'ReadingPartyController@sumupReply');           //评论回复
     //$api->post('/addsumupreply',    'ReadingPartyController@add_read_plan_comment_replay');//添加读书改进评论


     $api->post('/upgroupface', 'ReadingPartyController@update_read_party_img');   //修改读书会头像
     $api->post('/update_read_party_info', 'ReadingPartyController@update_read_party_info');//修改读书会信息


     $api->post('/addaward', 'AwardPlanController@awardPlanStore');          //添加读书会奖励规则
     $api->post('/awarddetail', 'AwardPlanController@getAwardPlanDetail');      //读取读书会奖励学习币
     $api->post('/resetmoney', 'AwardPlanController@resetMoneyAll');           //清空学习币

     /*** 读书会--结束 ***/


     /*** 2017-04-18 读书会修改 ***/


     $api->post('/modifygroupview', 'ReadingPartyController@read_party_detail');                    //查看读书会详细
     $api->post('/read_party_detail_v3', 'ReadingPartyController@read_party_detail_v3');              //查看读书会详细
     $api->post('/modifysumuppage', 'ReadingPartyController@paginate_book_sumup');                  //改进计划分页
     $api->post('/get_read_plan_info', 'ReadingPartyController@get_read_plan_info');                   //单条读书计划信息
     $api->post('/mobilelist', 'ReadingPartyController@check_member_mobile_list');             //通讯录

     $api->post('/modifyauditmember', 'ReadingPartyController@add_read_party_member');                //邀请会员加入读书会
     $api->post('/add_read_party_member', 'ReadingPartyController@add_read_party_member');            //邀请会员加入读书会
     $api->post('/update_read_party_member', 'ReadingPartyController@update_read_party_member');      //修改读书会会员


     $api->post('/modifygift', 'ReadingPartyController@read_party_book_gift');                 //赠礼物
     $api->post('/modifygroupmemberAll', 'ReadingPartyController@read_party_all_member');                //管理员读取所有群成员
     $api->post('/get_read_party_department_member', 'ReadingPartyController@read_party_department_member');//获得部门读书会成员
     $api->post('/read_party_member_detail', 'ReadingPartyController@read_party_member_detail');         //管理员读取所有群成员
     $api->post('/quitgroupadmin', 'ReadingPartyController@manager_remove_read_party_member');     //管理员删除读书会成员
     $api->post('/modifyregulation', 'ReadingPartyController@update_read_party_gulation');           //管理员修改群规

     $api->post('/singlesan', 'AwardPlanController@award_read_plan');                          //单个更新学习币
     $api->post('/bluksinglesan', 'AwardPlanController@blukSingleSanStore');                       //批量更新学习币
     $api->post('/multiReward', 'AwardPlanController@blukSingleSanStore');                      //批量更新学习币

     $api->post('/moneylog', 'AwardPlanController@getMemberMoneyLog');                       //学习币获取记录


     $api->post('/add_department', "CompanyController@add_department");
     $api->post('/get_department', "CompanyController@get_department");
     $api->post('/get_company_orgization', 'CompanyController@get_company_orgization');


     /*** 2017-04-18 读书会修改--结束 ***/


     /*====== 文章评论接口 ========*/
     $api->any('/home/showImages', 'ApiHomeController@showImages');    //首页轮播图接口
     $api->any('/booklist', 'BookController@getBookList');      //获取书籍列表页
     $api->any('/bookdetail', 'BookController@getbookdetail');    //获取书籍详情页
     $api->any('/homedetail', 'ApiHomeController@homedetail');    //获取热点推荐／自学习社区详情页
     $api->any('/setGood', 'ApiHomeController@setGood');       //热点推荐／自学习社区点赞
     $api->any('/setFavorite', 'ApiHomeController@setFavorite');   //热点推荐／自学习社区收藏
     $api->any('/setComment', 'ApiHomeController@setComment');    //热点推荐／自学习社区评论
     $api->any('/getComment', 'ApiHomeController@getComment');    //显示评论
     $api->any('/get_video_or_article_comment_share_info', 'ApiHomeController@get_video_or_article_comment_share_info');

     /*======== 消息接口 ========*/
     $api->any('/message/get_user_message', 'MessageController@get_user_message');
     $api->any('/message/get_unreaded_message_number', 'MessageController@get_unreaded_message_number');

     /*======== 与支付相关 =======*/
     $api->any('/pay/log_ios_pay', 'PayController@log_ios_pay');
     $api->post('pay/add_order', 'PayController@add_order');
     $api->post('pay/check_ios_pay_result', 'PayController@check_ios_pay_result');

     $api->any('/get_countries','CountryController@get_countries');

     //微表情测试
     $api->get('biaoqing', function () {
         return view('test.biaoqing', ['name' => 'name', 'name1' => 'name1']);
     });


     $api->post('biaoqing', 'TestController@biaoqing');

 });

